Skip to content

feat(notifications): route AMS attempt/governor/PR events through badge delivery - #7708

Closed
claytonlin1110 wants to merge 1 commit into
JSONbored:mainfrom
claytonlin1110:feat/ams-notification-events-7657-v2
Closed

feat(notifications): route AMS attempt/governor/PR events through badge delivery#7708
claytonlin1110 wants to merge 1 commit into
JSONbored:mainfrom
claytonlin1110:feat/ams-notification-events-7657-v2

Conversation

@claytonlin1110

Copy link
Copy Markdown
Contributor

Summary

  • Add AMS notification event kinds (ams_attempt_started, ams_attempt_failed, ams_governor_paused, ams_pr_outcome) to the existing NotificationEventType union and public-safe content builders.
  • Expose POST /v1/contributors/:login/ams-notifications that evaluates events through evaluateAndEnqueueNotificationDeliveries — the same evaluate → notify-deliver handoff as job-dispatch.ts.
  • Wire miner attempt start/fail, governor pause, and PR-outcome recording to publish through that path (session POST or injectable dispatch).

Closes #7657

Resubmit of #7691 (closed for incomplete UI Evidence after apps/loopover-ui/public/openapi.json regeneration). This change has no visible UI delta; evidence below documents Desktop/Tablet/Mobile · Dark (site is dark-mode-only) with production before/after pairs showing no visual change.

Scope

  • The PR title follows type(scope): short summary Conventional Commit format, for example fix(api): restore profile access checks.
  • This PR is focused and does not mix unrelated backend, UI, MCP, docs, dependency, and deploy changes.
  • This follows CONTRIBUTING.md and does not reintroduce GitHub Pages, VitePress, site/, or CNAME.
  • I linked a currently open issue this PR resolves (e.g. Closes #123) — a linked open issue is required for every contributor PR.

Validation

  • git diff --check
  • npm run actionlint
  • npm run typecheck
  • npm run test:coverage locally; codecov/patch requires ≥99% coverage of the lines AND branches you changed (aim for 100% on your diff so CI variance does not fail near the threshold). Global coverage is a non-blocking trend with a loose 90% backstop, not the gate.
  • npm run test:workers
  • npm run build:mcp
  • npm run test:mcp-pack
  • npm run ui:openapi (regenerated apps/loopover-ui/public/openapi.json)
  • npm run ui:lint
  • npm run ui:typecheck
  • npm run ui:build
  • npm audit --audit-level=moderate
  • New or changed behavior has unit/integration tests for new branches, fallback paths, and sanitizer boundaries

If any required check was skipped, explain why:

  • Full npm run test:ci / test:coverage not run locally on Windows (known executable-bit / miner-pack / selfhost script friction); focused unit suites for changed notification + miner + cloudflare-schema paths were run and passed. CI is the authoritative gate.

Safety

  • No secrets, wallet details, hotkeys, coldkeys, user PATs, private keys, raw trust scores, private rankings, or private maintainer evidence are exposed.
  • Public GitHub text stays sanitized, low-noise, and does not imply compensation guarantees or optimization tactics.
  • Auth, cookie, CORS, GitHub App, Cloudflare, or session changes include negative-path tests.
  • API/OpenAPI/MCP behavior is updated and tested where needed.
  • UI changes use live API data or real empty/error/loading states, not production mock/demo fallbacks.
  • Visible UI changes include a UI Evidence section below with JPG/JPEG or PNG screenshots arranged as organized, captioned, clickable thumbnails. SVG screenshots are not used as review evidence. Review-only screenshots or recordings are not committed to the repository.
  • Public docs/changelogs are updated where needed; changelogs are only edited for release-prep PRs.

UI Evidence

apps/loopover-ui/public/openapi.json is regenerated for the new API route only — no rendered UI/CSS/route change. loopover-ui is dark-mode-only. Before = production; after = same production capture (no visual delta).

Viewport · Theme Before After
Desktop · Dark Desktop Dark before Desktop Dark after
Tablet · Dark Tablet Dark before Tablet Dark after
Mobile · Dark Mobile Dark before Mobile Dark after

Notes

  • src/db/schema.ts only gains a comment documenting AMS event_type strings; no migration (column remains free-text).
  • Miner publish is fail-soft: missing loopover-mcp session skips notify without failing attempt/governor/PR-outcome work.

…ge delivery

Extend evaluateNotificationEvent to notify-deliver with AMS event kinds, add contributor ams-notifications ingest, and wire miner attempt/governor/PR-outcome call sites. Regenerates openapi.json for the new route (no visual UI change).

Closes JSONbored#7657
@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@codecov

codecov Bot commented Jul 21, 2026

Copy link
Copy Markdown

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
6851 1 6850 7
View the top 1 failed test(s) by shortest run time
test/unit/check-build-drift-script.test.ts > check-build-drift script > CLI (real subprocess) > reports the real repo's loopover-mcp output as clean
Stack Traces | 0.132s run time
Error: Command failed: .../hostedtoolcache/node/22.23.1.../x64/bin/node scripts/check-build-drift.mjs mcp
check-build-drift: packages/loopover-mcp's committed .js/.d.ts is stale relative to its .ts source -- run `npm run build:mcp` and commit the result:
M .../loopover-mcp/bin/loopover-mcp.js

 ❯ test/unit/check-build-drift-script.test.ts:105:22

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
Serialized Error: { status: 1, signal: null, output: [ null, '', 'check-build-drift: packages/loopover-mcp\'s committed .js/.d.ts is stale relative to its .ts source -- run `npm run build:mcp` and commit the result:\nM .../loopover-mcp/bin/loopover-mcp.js\n' ], pid: 6256, stdout: '', stderr: 'check-build-drift: packages/loopover-mcp\'s committed .js/.d.ts is stale relative to its .ts source -- run `npm run build:mcp` and commit the result:\nM .../loopover-mcp/bin/loopover-mcp.js\n' }

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

@loopover-orb loopover-orb Bot added the gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. label Jul 21, 2026
@loopover-orb

loopover-orb Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Caution

🛑 LoopOver review result - fixes required

Review updated: 2026-07-21 10:17:23 UTC

29 files · no blockers · CI failing · blocked

🛑 Suggested Action - Fix Blockers

  • AI review already in progress for this PR head: Another LoopOver pass is already running the AI review for this exact PR head. This pass is skipping to avoid a duplicate LLM call.

Review summary
AI review is already running for this PR head in another LoopOver pass. LoopOver is holding this PR for manual review until that pass completes.

Nits — 3 non-blocking
  • Possible screenshot-table issue: identical images (row 1) — Advisory only — verify the screenshot-table images against the stated change before deciding.
  • Possible screenshot-table issue: pair 1 — Advisory only — verify the screenshot-table images against the stated change before deciding.
  • AI review already in progress for this PR head — The gate is held for a human reviewer rather than passed automatically; it re-evaluates once the in-flight review completes or on the next update.

CI checks failing

  • validate
  • validate-code
  • validate-tests (3)

Decision drivers

  • ✅ Code review — No blockers (No AI review summary)
  • ⚠️ Gate result — Not blocking (Advisory; not blocking this PR.)
Context & advisory signals — never blocks the verdict
Signal Result Evidence
Linked issue ✅ Linked #7657
Related work ✅ No active overlap found No same-issue or scoped active PR overlap found.
Change scope ✅ 20/20 Low review scope from cached public metadata (1 linked issue).
Validation posture ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 390 registered-repo PR(s), 259 merged, 87 issue(s).
Contributor context ✅ Confirmed Gittensor contributor claytonlin1110; Gittensor profile; 390 PR(s), 87 issue(s).
Improvement ✅ Minor risk: clean · value: minor
Linked issue satisfaction

Partially addressed
The PR correctly extends the existing notify-evaluate/notify-deliver path (service.ts's evaluateAndEnqueueNotificationDeliveries mirrors job-dispatch.ts, and adds ams_attempt_started/failed/governor_paused/pr_outcome to the event-kind union with public-safe content builders), and governor pause is concretely wired to fire notifications at the actual pause call site. However, the visible diff only

Review context
  • Author: claytonlin1110
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: Python, JavaScript, TypeScript, Rust
  • Official Gittensor activity: 390 PR(s), 87 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Keep the PR focused and include validation evidence before maintainer review.
Signal definitions
  • Related work = same linked issue, overlapping active PRs, or title/path similarity.
  • Change scope = cached public metadata such as size labels, draft state, and review-burden hints.
  • Validation posture = whether the PR provides enough public validation/test evidence for maintainer review.
  • Contributor workload = public contributor activity and cleanup pressure, not a repo-wide quality failure.
  • Contributor context = public GitHub/Gittensor identity context; non-Gittensor status is not a blocker.
🧪 Chat with LoopOver

Ask LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.

  • @loopover ask <question> answers contribution-quality Q&A with source citations and freshness.
  • @loopover chat <question> answers in natural prose from cached decision-pack facts via local inference (maintainer/collaborator; read-only).
  • A plain-language @loopover mention with a real question is routed to the closest matching read-only command automatically — no exact syntax required.

Full command reference: https://loopover.ai/docs/loopover-commands

🧪 Experimental — new and may change.

Visual preview
Route Viewport Before (production) After (this PR's preview) Diff
/ desktop before /
before /
after /
after /
/ mobile before / (mobile)
before / (mobile)
after / (mobile)
after / (mobile)

Click any thumbnail to open the full-size screenshot. Before = production · After = this PR's preview deploy.

Scroll preview
Route Before (production) After (this PR's preview)
/ before / (scroll)
before / (scroll)
after / (scroll)
after / (scroll)

A short scroll-through clip (desktop) — click either thumbnail to open the full animation. Evidence for scroll-linked behavior a single screenshot can't show.

🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed


💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →.

Checked by LoopOver, a quiet PR intelligence layer for OSS maintainers.

  • Re-run LoopOver review

@loopover-orb

loopover-orb Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

LoopOver is closing this pull request on the maintainer's behalf (CI is failing (validate, validate-code, validate-tests (3))). This is an automated maintenance action — to pursue this change, please open a new pull request with the issues resolved. Closed PRs may be analyzed later to improve review accuracy, but they are not automatically reopened or re-reviewed.

@loopover-orb loopover-orb Bot closed this Jul 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Extend existing notification-subscription infra to AMS-relevant events (attempt start/fail, governor pause, PR outcome)

1 participant